package com.neighbor.neighborhooduser.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neighbor.neighborhooduser.pojo.Notifications;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 系统通知表 服务类
 * </p>
 *
 * @author song
 * @since 2025-09-22 09:13:04
 */
public interface INotificationsService extends IService<Notifications> {

    Notifications latestNotice();
    // 发送通知给指定用户
    boolean sendNotification(Notifications notification);

    // 发送广播通知给所有用户
    boolean sendBroadcastNotification(Notifications notification);

    // 分页查询用户通知
    IPage<Notifications> getUserNotifications(Integer userId, Integer type, int pageNum, int pageSize);

    // 标记通知为已读
    boolean markAsRead(Integer notificationId, Integer userId);

    // 标记所有通知为已读
    boolean markAllAsRead(Integer userId);

    // 获取未读通知数量
    Integer getUnreadCount(Integer userId);

    List<Notifications> getAllNotification(Integer userId);
}
